package com.wnhz.work.yz.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.wnhz.work.yz.BaseActivity;
import com.wnhz.work.yz.R;

/**
 * ---接待评价
 */
public class ReceptionEvaluateActivity extends BaseActivity implements View.OnClickListener {
    private TextView title;
    private TextView tv_right;

    private ImageView iv_img1, iv_img2, iv_img3, iv_img4, iv_img5, iv_img6, iv_img7, iv_img8, iv_img9;

    private EditText et_opinion;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_reception_evaluate);

        initData();
        initView();
    }

    private void initData() {

    }

    private void initView() {
        title = (TextView) findViewById(R.id.view_main_middle_title);
        title.setText("接待评价");
        findViewById(R.id.btn_main_left).setOnClickListener(this);
        findViewById(R.id.btn_main_left).setOnClickListener(this);
        findViewById(R.id.btn_main_right).setVisibility(View.VISIBLE);
        findViewById(R.id.btn_main_right).setOnClickListener(this);
        tv_right = (TextView) findViewById(R.id.view_main_right_text);
        tv_right.setVisibility(View.VISIBLE);
        tv_right.setText("提交");
        tv_right.setTextColor(0xff008c99);

        iv_img1 = (ImageView) findViewById(R.id.iv_img1);
        iv_img2 = (ImageView) findViewById(R.id.iv_img2);
        iv_img3 = (ImageView) findViewById(R.id.iv_img3);
        iv_img4 = (ImageView) findViewById(R.id.iv_img4);
        iv_img5 = (ImageView) findViewById(R.id.iv_img5);
        iv_img6 = (ImageView) findViewById(R.id.iv_img6);
        iv_img7 = (ImageView) findViewById(R.id.iv_img7);
        iv_img8 = (ImageView) findViewById(R.id.iv_img8);
        iv_img9 = (ImageView) findViewById(R.id.iv_img9);

        findViewById(R.id.rl_good).setOnClickListener(this);
        findViewById(R.id.rl_soso).setOnClickListener(this);
        findViewById(R.id.rl_bad).setOnClickListener(this);
        findViewById(R.id.rl_good2).setOnClickListener(this);
        findViewById(R.id.rl_soso2).setOnClickListener(this);
        findViewById(R.id.rl_bad2).setOnClickListener(this);
        findViewById(R.id.rl_clean).setOnClickListener(this);
        findViewById(R.id.rl_common).setOnClickListener(this);
        findViewById(R.id.rl_dirty).setOnClickListener(this);

        et_opinion = (EditText) findViewById(R.id.et_opinion);
    }

    @Override
    public void onClick(View v) {
        Intent intent;
        switch (v.getId()) {
            case R.id.btn_main_left:
                finish();
                break;

            //提交
            case R.id.btn_main_right:
                MyToast("提交");
                break;

            //满意
            case R.id.rl_good:
                iv_img1.setImageResource(R.mipmap.ic_choose_li);
                iv_img2.setImageResource(R.mipmap.ic_choose_nor);
                iv_img3.setImageResource(R.mipmap.ic_choose_nor);
                break;

            //一般
            case R.id.rl_soso:
                iv_img1.setImageResource(R.mipmap.ic_choose_nor);
                iv_img2.setImageResource(R.mipmap.ic_choose_li);
                iv_img3.setImageResource(R.mipmap.ic_choose_nor);
                break;

            //较差
            case R.id.rl_bad:
                iv_img1.setImageResource(R.mipmap.ic_choose_nor);
                iv_img2.setImageResource(R.mipmap.ic_choose_nor);
                iv_img3.setImageResource(R.mipmap.ic_choose_li);
                break;

            //满意
            case R.id.rl_good2:
                iv_img4.setImageResource(R.mipmap.ic_choose_li);
                iv_img5.setImageResource(R.mipmap.ic_choose_nor);
                iv_img6.setImageResource(R.mipmap.ic_choose_nor);
                break;

            //一般
            case R.id.rl_soso2:
                iv_img4.setImageResource(R.mipmap.ic_choose_nor);
                iv_img5.setImageResource(R.mipmap.ic_choose_li);
                iv_img6.setImageResource(R.mipmap.ic_choose_nor);
                break;

            //较差
            case R.id.rl_bad2:
                iv_img4.setImageResource(R.mipmap.ic_choose_nor);
                iv_img5.setImageResource(R.mipmap.ic_choose_nor);
                iv_img6.setImageResource(R.mipmap.ic_choose_li);
                break;

            //整洁、干净
            case R.id.rl_clean:
                iv_img7.setImageResource(R.mipmap.ic_choose_li);
                iv_img8.setImageResource(R.mipmap.ic_choose_nor);
                iv_img9.setImageResource(R.mipmap.ic_choose_nor);
                break;

            //一般
            case R.id.rl_common:
                iv_img7.setImageResource(R.mipmap.ic_choose_nor);
                iv_img8.setImageResource(R.mipmap.ic_choose_li);
                iv_img9.setImageResource(R.mipmap.ic_choose_nor);
                break;

            //脏、乱
            case R.id.rl_dirty:
                iv_img7.setImageResource(R.mipmap.ic_choose_nor);
                iv_img8.setImageResource(R.mipmap.ic_choose_nor);
                iv_img9.setImageResource(R.mipmap.ic_choose_li);
                break;


            default:
                break;
        }
    }
}
